package com.hundun.hddeal.dao;

import com.hundun.hddeal.entity.Gzh;
import com.hundun.hddeal.entity.GzhBody;
import com.hundun.hddeal.entity.GzhCount;
import com.hundun.hddeal.entity.GzhExample;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 公众号接口
 * @author 谢
 */
@Component
public interface GzhMapper {
    long countByExample(GzhExample example);

    int deleteByExample(GzhExample example);

    int deleteByPrimaryKey(Long id);

    int insert(Gzh record);

    int insertSelective(Gzh record);

    List<Gzh> selectByExample(GzhExample example);

    GzhBody selectByPrimaryKey(String ghId);

    Gzh selectById(Long id);

    int updateByExampleSelective(@Param("record") Gzh record, @Param("example") GzhExample example);

    int updateByExample(@Param("record") Gzh record, @Param("example") GzhExample example);

    int updateByPrimaryKeySelective(Gzh record);

    int updateByPrimaryKey(Gzh record);

    int updateGzh(Gzh record);


    /*** 通过用户Id查询 */
    List<GzhBody> selectByMtId(@Param("mtId") String  mtId,@Param("status") Byte status,@Param("gzhName")String gzhName
            ,@Param("gzhSex")Double gzhSex,@Param("list")List typeName,@Param("cityOne")String cityOne,
                           @Param("gzhType")Integer gzhType,@Param("readOne")Double readOne,
                               @Param("readTwo")Double readTwo,@Param("fans")Integer fans,
                               @Param("scoreOne")Double scoreOne,@Param("scoreTwo")Double scoreTwo,
                               @Param("ghId")String ghId,@Param("admin")String admin,@Param("failureCookie")Integer failureCookie);

    List<Gzh> selectMtId(Long mtId);

    /** 通过用户id查询 */
    List <Gzh> selectByGzhId(@Param("list") Long[] ghIds);

    Gzh selectByGhId(String ghId);

    List <Gzh> selectAllGzh();

    /** 通过GhId删除 */
    int deleteByGhId(String ghId);

    //分类查询
    List <GzhBody> findByGzh(@Param("list")List typeName,@Param("gzhAge")Integer gzhAge,@Param("gzhSex")Double gzhSex,@Param("gzhPrice")Integer gzhPrice,@Param("fansType")Integer fansType,
                             @Param("readNum") Integer readNum,@Param("cityOne")String cityOne,@Param("status")Byte status,@Param("gzhName")String gzhName,@Param("ghId")String ghId,
                             @Param("gzhType")Integer gzhType,@Param("sort")Integer sort,@Param("score")Double score);


    //连表查询单个公众号发文情况
    GzhBody selectGzhBody(String ghId);

    //添加公众号数据表
    int setGzhData(@Param("ghId") String ghId);

    //查询是否有公众号数据表ghid
    int selectGzhData(@Param("ghId") String ghId);

    //查看公众号数量
    int selectCount();

    List <Gzh> selectByGhIds(@Param("list") String[] ghIds);

     GzhCount getGzhCount(@Param("mtId") String  mtId);

}